import {Form, Radio} from "antd";
import BaseEntity from "@/type/BaseEntity";
import InputProps from "@/common/form/porps";
import React from "react";
interface IProps<T extends BaseEntity> extends InputProps<T>{
    firstText: string | React.ReactNode,
    lastText: string | React.ReactNode,
    firstValue?: boolean | string | number,
    lastValue?: boolean | string | number,
}
const InputRadio = <T extends BaseEntity>(props: IProps<T>) => {

    return (
        <Form.Item<T> name={props.name as any} label={props.label} required={props.required}>
            <Radio.Group>
                <Radio value={ props.firstValue ?? true}>{props.firstText}</Radio>
                <Radio value={ props.lastValue ?? false}>{props.lastText}</Radio>
            </Radio.Group>
        </Form.Item>
    );
};

export default InputRadio;